#include<bits/stdc++.h>
using namespace std;
int main()
{
	int v;
	cin>>v;
	double sum = 0;
	if(v <= 26)
		sum = 1.98*v;
	else if(v <= 37)
//		sum = 26*1.98+(v-26)*2.97;
		sum = v*2.97;
	else
//		sum = 26*1.98+(37-26)*2.97+(v-37)*3.96;
		sum = v*3.96;
	cout<<fixed<<setprecision(2)<<sum;
    return 0;
}

